package com.ct.ecommerce.framework.enums;

/**
 * @author changtong
 * @date 2021-50-20
 */
public enum PayTypeEnum {
    /**
     * 支付类型：1支付宝 2微信 3网银
     */
    AliPay(1, "支付宝"),
    WechatPay(2, "微信"),
    NetSilver(3, "网银");

    private final int value;

    private final String showName;

    PayTypeEnum(int value, String showName) {
        this.value = value;
        this.showName = showName;
    }

    public static PayTypeEnum valueOf(int value) {
        for (PayTypeEnum s : PayTypeEnum.values()) {
            if (s.value == value) {
                return s;
            }
        }
        throw new IllegalArgumentException(String.format("值%s不能转换成枚举", value));
    }


    public String getShowName() {
        return showName;
    }

    public int getValue() {
        return value;
    }
}
